package com.dhwl.hsh.driver.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dhwl.hsh.driver.R;
import com.dhwl.hsh.lib.view.CircleImageView;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 银行卡列表
 *
 * @author Derek.Kidd
 * @version V1.0.0
 * @date 2016-04-28 17:48
 */
public class BankListAdapter extends BaseAdapter {


    public BankListAdapter(Context context, List list) {
        super(context, list);
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder;
        if (null == convertView) {
            convertView = LayoutInflater.from(context).inflate(R.layout.item_bank_list, null);
            viewHolder = new ViewHolder(convertView);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }


        return convertView;
    }


    static class ViewHolder {
        @Bind(R.id.icon_bank)
        CircleImageView iconBank;
        @Bind(R.id.tv_bank_name)
        TextView tvBankName;
        @Bind(R.id.tv_bank_card_type)
        TextView tvBankCardType;
        @Bind(R.id.tv_bank_card_num)
        TextView tvBankCardNum;
        @Bind(R.id.checkBox_item_bank)
        CheckBox checkBoxItemBank;
        @Bind(R.id.layout_truck)
        RelativeLayout layoutTruck;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
